package org.osll.tictactoe.client.gui;

import java.util.ArrayList;
import java.util.Vector;

import org.osll.tictactoe.Move;
import org.osll.tictactoe.Size;
import org.osll.tictactoe.Team;

/**
 * локальная копия с игровым полем
 */
public class Field {
	private Team[][] field;
	private int dimX;
	private int dimY;
	
	public Field(Size size) {
		dimX = size.getWidth();
		dimY = size.getHeight();
		field = new Team[dimX][dimY];
		for(int i=0; i<dimX; ++i) {
			for(int j=0; j<dimY;++j)
				field[i][j]= Team.U;
		}
	}
	
	void addMove(Move move) {
		field[move.getRow()][move.getCol()] = move.getTeam();
	}
	
	int height() {
		return dimX;
	}
	
	int width() {
		return dimY;
	}
	
	Team get(int row, int col) {
		return field[row][col];
	}
}
